#pragma once

#include <vector>
#include "CNode.h"
#include "CFile.h"

class CNetwork
{
public:
	//CNetwork();
	CNetwork(int num, int physNodes, int regNodes, int superNodes, int files, int xMax=50, int yMax=50);
	~CNetwork();
	struct loc
	{
		std::vector< CNode > nodes;
	};

	void Update(double time);
	void End();
	int getID() {return ID;}
	
	void CreateFiles();
	void AssignFiles();
	void MakeConnections();
	std::vector< CNode* > findClosestN(int n, int x, int y, int range, double oX, double oY);

private:
	std::vector< std::vector< loc > > grid; //Grid of physical world, helps nearest neighbor searches
	std::vector< CFile > files;
	int ID; //ID number of network, for output purposes
	int currentNodeID;
	int pNodes; //Number of physical nodes
	int f; //Number of files
	double currentTime; //Current time, for use in update
};